package spring_09_aop_1before;

import org.junit.Test;

import com.firewolf.spring.service.ICalucator;
import com.firewolf.spring.service.origin.Calculator1;
import com.firewolf.spring.service.proxy.Calculator2;
import com.firewolf.spring.service.proxy.LogHandler;

public class MainDriver {
	
	@Test
	public void testOrignlCalculator(){
		ICalucator calucator = new Calculator1();
		double i = 4;
		double j = 3;
		calucator.add(i, j);
		calucator.sub(i, j);
		calucator.multi(i, j);
		calucator.dev(i, j);
	}
	
	@Test
	public void testProxy(){
		ICalucator calucator =(ICalucator) LogHandler.createProxy(new Calculator2());
		double i = 4;
		double j = 3;
		calucator.add(i, j);
		calucator.sub(i, j);
		calucator.multi(i, j);
		calucator.dev(i, j);
	}
}
